求VB代码````每15秒按1次X```要可以关闭的```按F1停止``

来源:百度知道 编辑:UC知道 时间:2024/06/22 19:38:14
2楼的代码不行啊,双击后出现:
行: 11
字符:33
错误:缺少')'
代码800A03EE
源;MICRSOFT VBScript编译错误

还有就是按F1就是停止按键,也就是关闭。

Private Sub Command1_Click()
Timer1.Enabled = True
Timer1.Interval = 1500
End Sub

Private Sub Form_Load()
Command1.Caption = "开始"
Timer1.Enabled = False
End Sub

Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = "112" Then
Timer1.Enabled = False
End If
End Sub

Private Sub Timer1_Timer()
SendKeys "x"
End Sub

新建计时器,时间设为15000,添加代码:
text1.text = sendkey "x"

要关闭什么